﻿@model UcAsp.Net.Model.Categories
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>分类管理</title>
    <script type="text/javascript">
        tinymce.init({
            selector: "textarea",
            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste hr upfile"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |link image upfile"

        });
        $(document).ready(function () {
            $("#savecate").click(function () {
                $.post("/Admin/SaveCategories", { KeyWords: $("input[name='Keywords']").val(), ShowPath: $("input[name='ShowPath']").val(), ID: $("input[name='ID']").val(), CategorieName: $("input[name='CategorieName']").val(), ParentID: $("select[name='ParentID']").val(), Remark: tinyMCE.get("Remark").getContent(), TmepPath: $("select[name='TmepPath']").val(), Rate: $("input[name='Rate']").val(), ContentTempPath: $("select[name='ContentTempPath']").val() }, function (dataResult) {
                    location.reload();
                });
            })
        })
</script>
</head>
<body>
    <form action="#" method="post">
    <div>
        <input name="ID" type="hidden" value="@Model.ID" />
        <p>
              <label>文章标题</label>
              <input class="text-input medium-input" type="text" id="CategorieName" name="CategorieName" value="@Model.CategorieName" />
        </p>
        
           <p>
            <label>分类选择</label>
            <select  name="ParentID">
            <option class="margin-left0"  value="0">根目录</option>
                            @{int i = 0;}
                                @foreach (UcAsp.Net.Model.Select c in (List<UcAsp.Net.Model.Select>)ViewData["Categories"])
                                {

                                    if (Model.CategorieName != null)
                                    {
                                            <option class="margin-left@{@c.Depth}"  value="@c.Value" @if (Model.ParentID == int.Parse(c.Value))
                                                                                                     { <text>selected</text> }>@c.Name</option>
                                    }
                                    else
                                    {
                                            <option class="margin-left@{@c.Depth}"  value="@c.Value">@c.Name</option>
                                    }
                                    i++;
                                }
                               
                                
                            </select>



                
            </p>
        <p>
              <label>SEO关键词</label>
              <input class="text-input large-input" type="text" id="KeyWords" name="Keywords" value="@Model.KeyWords" />
        </p>
        <p>
              <label>描述</label>
            
            <textarea id="Remark" name="Remark" cols="20" rows="2">@Model.Remark</textarea>
        </p>


      <p>
              <label>分类模板路径</label>
              @Html.DropDownListFor(m => m.TmepPath, (SelectList)ViewData["categorieslist"])
            
        </p>
        <p>
              <label>内容模板路径</label>
              @Html.DropDownListFor(m => m.ContentTempPath, (SelectList)ViewData["contentlist"])
              
        </p>
        <p>
              <label>显示路径</label>
              <input class="text-input large-input" type="text" id="ShowPath" name="ShowPath" value="@Model.ShowPath" />
        </p>
        <p>
              <label>排序</label>
              <input class="text-input medium-input" type="text" id="Rate" name="Rate" value="@Model.Rate" />
        </p>
        <p> 
               <input class="btn btn-primary" id="savecate" type="button" value=" 保存 " />
      </p>
        
    </div>
        </form>
</body>
</html>
